
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_base_app/base/base_page.dart';
import 'package:flutter_base_app/base/base_page_view_model.dart';
import 'package:flutter_base_app/base/system_ui_styles.dart';
import 'package:flutter_base_app/widgets/ball/ball_model.dart';
import 'package:flutter_base_app/widgets/ball/ball_widget.dart';

class BallPage extends StatefulWidget {
  const BallPage({super.key});

  @override
  State<BallPage> createState() => _BallPageState();
}

class _BallPageState extends BasePageState<BasePageViewModel, BallPage> {

  @override
  Widget buildContent(BuildContext context) {
    var ballList = [
      Ball(name: "test1"),
      Ball(name: "test2"),
      Ball(name: "test3"),
      Ball(name: "test4"),
    ];
    var width = MediaQuery.of(context).size.width;
    var height = MediaQuery.of(context).size.height;
    return Container(
      height: height,
      width: width,
      child: PhysicsBallWidget(
        ballList: ballList,
        height: height,
        width: width,
        badgeSize: 75,
        builder: (context, ball) {
          return GestureDetector(
            onTap: () {
            },
            child: Container(
              decoration: BoxDecoration(
                color: Colors.amber,
                borderRadius: BorderRadius.circular(75),
              ),
              alignment: Alignment.center,
              width: double.infinity,
              height: double.infinity,
              child: Text(ball.name),
            ),
          );
        },
      ),
    );
  }

  @override
  BasePageViewModel createViewModel() {
    return BasePageViewModel();
  }
}
